//
//  CFriend.h
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-13.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CUser.h"

@class CDBManager;
@class CKey;

#define Friend_Properties_Num   10

@interface CFriend : NSObject

@property (nonatomic, retain) NSString * F_Nick;
@property (nonatomic, retain) NSString * F_City;
@property (nonatomic, retain) NSString * F_UrlIcon;

@property (nonatomic, retain) NSNumber * F_AID;
@property (nonatomic, retain) NSNumber * U_AID;

@property (nonatomic, retain) NSNumber * F_Online;
@property (nonatomic, retain) NSNumber * F_Attent;
@property (nonatomic, retain) NSNumber * F_Attented;
@property (nonatomic, retain) NSNumber * F_Pub;

@property (nonatomic, retain) NSString      *F_Icon;
@property (nonatomic, assign) BOOL          m_IsIconLoad;
@property (nonatomic, assign) CTask         *m_FIconOpID;
@property (nonatomic, retain) UIImageView   *m_FIconView;

+(int)CreateFriendTable:(NSString*)tablename;
+(NSArray*)GetFriends:(NSString*)tablename Where:(NSString*)where Offset:(int)offset Limit:(int)limit;
+(NSInteger)GetFriendCount:(NSString*)tablename where:(NSString*)where;
+(int)RemoveFriend:(NSString*)tablename Where:(NSString*)where;
+(int)UpdateFrinedInfo:(NSString*)tablename Where:(NSString*)where Keys:(NSArray*)keys;

-(void)SetFriendWithDic:(NSDictionary*)dic;
-(void)SetFriendWithArr:(NSArray*)arr;
-(int)SaveFriend:(NSString*)tablename;
-(int)SaveIcon:(NSData*)data;
-(NSData*)GetFriendIcon;
-(int)DownloadFriendIcon;

@end
